import sys
from PyQt5.QtWidgets import QWidget, QPushButton, QApplication, QLabel
from PyQt5.QtGui import QPalette, QBrush, QPixmap
from PyQt5 import QtCore


class Example(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
        self.initUI()  # 界面绘制交给InitUi方法

    def initUI(self):

        pix = QPixmap("D:\\GIT\\hdmi_switch\\hdmi_switch\\host\\qt\\r.bmp")

        lb1 = QLabel(self)
        # lb1.setGeometry(0, 0, 300, 200)
        lb1.setStyleSheet("border: 0px solid green")
        lb1.setPixmap(pix)

        # 设置窗口的位置和大小
        self.setGeometry(300, 300, 800, 800)
        # 设置窗口的标题
        self.setWindowTitle("Example")

        # 显示窗口
        self.show()


if __name__ == "__main__":
    # 创建应用程序和对象
    app = QApplication(sys.argv)
    ex = Example()
    sys.exit(app.exec_())
